package app;


import com.StarMicronics.StarIOSDK.*;

import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.*;


public class WaittingAlertView extends Dialog {
	private ProgressBar progress;
	private TextView text_title;
	public Button button;
	
	private void init()
	{
		setContentView(R.layout.waitting_alert_view);
		
		button = (Button)this.findViewById(R.id.waitting_alert_button);
		progress = (ProgressBar)this.findViewById(R.id.waitting_alert_progress);
		text_title = (TextView)this.findViewById(R.id.waitting_alert_text);
		button.setOnClickListener(new android.view.View.OnClickListener(){
	        	public void onClick(View v) {
	        		cancel();
	        	}
		});
	}
	public static WaittingAlertView createWaittingAlertView() {
		WaittingAlertView waittingAlert = new WaittingAlertView(AppDelegate.sharedInstance().activity, R.style.myDialogTheme);
		waittingAlert.init();
		return waittingAlert;
	}
	private WaittingAlertView(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
	}
	
	private WaittingAlertView(Context context, int style) {
		super(context, style);
	}
	
	public void setLoadingText(String loading) {
		progress.setVisibility(View.VISIBLE);
		button.setVisibility(View.INVISIBLE);
		text_title.setText(loading);
	}
	
	public void setTitle(String str) {
		progress.setVisibility(View.INVISIBLE);
		button.setVisibility(View.VISIBLE);
		text_title.setText(str);
	}
}
